package com.unicloud.medical.oss.common;

import com.unicloud.medical.oss.common.model.BucketInfo;
import com.unicloud.medical.oss.common.model.DownloadObject;
import com.unicloud.medical.oss.common.model.ObjectInfo;
import com.unicloud.medical.oss.common.model.request.*;
import com.unisound.medical.common.model.dto.ResultDTO;

import java.util.List;

public interface Endpoint {
    /**
     * 查看存储桶是否存在
     */
    ResultDTO<Boolean> bucketExist(BucketExistRequest request);

    /**
     * 创建存储桶
     */
    ResultDTO<Boolean> createBucket(CreateBucketRequest request);

    /**
     * 创建默认权限存储桶
     */
    ResultDTO<Boolean> createDefaultPolicyBucket(CreateBucketRequest request);

    /**
     * 删除存储桶
     */
    ResultDTO<Boolean> removeBucket(DeleteBucketRequest request);

    /**
     * 获取全部存储桶
     */
    ResultDTO<List<BucketInfo>> getAllBuckets(CommonRequest request);

    /**
     * 获取当前存储桶所有文件
     */
    ResultDTO<List<ObjectInfo>> listAllObjectsCurrBucket(ListAllObjectsCurrBucketRequest request);

    /**
     * 获取当前存储桶当前文件夹所有文件
     */
    ResultDTO<List<ObjectInfo>> listObjectsCurrBucketAndFolder(ListAllObjectsCurrBucketAndFolderRequest request);

    /**
     * 文件上传
     */
    ResultDTO<String> uploadObject(InnerUploadObjectRequest request);

    /**
     * 批量文件上传
     */
    ResultDTO<List<String>> uploadObjects(InnerUploadObjectsRequest request);

    /**
     * 本地文件上传
     */
    ResultDTO<String> uploadLocalObject(UploadLocalObjectRequest request);
    /**
     * 批量本地文件上传
     */
    ResultDTO<List<String>> uploadLocalObjects(UploadLocalObjectsRequest request);

    /**
     * 文件下载
     */
    ResultDTO<DownloadObject> downloadObject(DownloadObjectRequest request);
    ResultDTO<DownloadObject> downloadObjects(DownloadObjectsRequest request);

    /**
     * 根据url地址删除文件
     */
    ResultDTO<String> removeObject(RemoveObjectRequest request);

    /**
     * 根据url地址列表批量删除文件
     */
    ResultDTO<List<String>> removeObjects(RemoveObjectsRequest request);

    /**
     * 删除当前桶当前文件夹所有文件
     */
    ResultDTO<List<String>> removeObjects(RemoveObjectsCurrBucketAndFolderRequest request);

    /**
     * 文件复制
     */
    ResultDTO<String> copyObject(CopyObjectRequest request);

    /**
     * 已签名的地址
     */
    ResultDTO<String> signedUrl(SignedUrlRequest request);

    /**
     * 批量已签名地址
     */
    ResultDTO<List<String>> signedUrls(SignedUrlsRequest request);

}
